<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page session="false" %>
<%@ page isELIgnored ="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title></title>
	<style type="text/css">
		@import "${pageContext.request.contextPath}/assets/dojo/dijit/themes/claro/claro.css";
		@import "${pageContext.request.contextPath}/assets/dojo/dojo/resources/dojo.css";
		@import "${pageContext.request.contextPath}/assets/style/module.css";
		@import "${pageContext.request.contextPath}/assets/style/applist.css";
	</style>
	<style type="text/css">
		body, html { width:100%; height:100%; margin:0; padding:0; overflow:hidden; }
		#borderContainer { width:100%; height:100% }
	</style>
	<script src="${pageContext.request.contextPath}/assets/appscript/dojoconfigbaseurl.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/assets/appscript/dojoconfig.js" type="text/javascript"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/assets/dojo/dojo/dojo.js" data-dojo-config="parseOnLoad: true,async:true,locale:'zh',isDebug: false"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/assets/kanas/kanas-base.js"></script>

</head>

<body class="claro loading">
	<script type="text/javascript">
	//<![CDATA[
	    $ka.loading("load()");
		function load(){
			require(["dojo/ready","dojo/i18n!appscript/locale/nls/AppCenter","dojo/dom-class","appscript/Module","dojo/_base/kernel","dojo/_base/loader","dojo/parser","dijit/layout/BorderContainer",
					"dijit/layout/ContentPane","dijit/layout/AccordionContainer","dijit/layout/StackContainer","dojox/layout/ContentPane",
					"dijit/Menu","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator"],
				function(ready,i18n,domClass,module){
					if(typeof AppCenter ==="undefined"){
						AppCenter={
							_resource:i18n,
							init:function(){
								dojo.xhrGet({
									url:'${pageContext.request.contextPath}/cgi/kanas/access/category',
									handleAs:"json",
									load:function(response){
										if(response.items[0])$ku.loadDojoExt({url:"../applist/"+response.items[0].id+".html",target:"mainext"});
										AppCenter.createMenu(response.items,menuAppList);
									}
								});
							},
							resource:function(str,array,defaultValue){
								return $ki18n(AppCenter._resource,str,array,defaultValue);
							},
							createMenu:function(items,parent){
								for(var idx in items){
									if(items[idx].subCategories&&items[idx].subCategories.length>0){
										var pSubMenu = new dijit.Menu({parentMenu:parent});
										var menuItem=new dijit.PopupMenuItem({label:AppCenter.resource(items[idx].name), popup:pSubMenu,id:items[idx].id});
										dojo.connect(menuItem.domNode,"click",menuItem,function(){$ku.loadDojoExt({url:'../applist/'+this.get("id")+'.html',target:'mainext'});});
										parent.addChild(menuItem);
										this.createMenu(items[idx].subCategories,pSubMenu);
									}else{
										parent.addChild(new dijit.MenuItem({id:items[idx].id,iconClass:items[idx].iconS,label:AppCenter.resource(items[idx].name),onClick:function(){$ku.loadDojoExt({url:'../applist/'+this.get("id")+".html",target:'mainext'});}}));
									}
									if(idx!=items.length-1)parent.addChild(new dijit.MenuSeparator());
								}
							}
						};
					};
					ready(function(){
						module.nodeLoaded(document.body);
						AppCenter.init();
					});
			});
		}
	//]]>
	</script>
<div data-temp-attr="temp" data-dojo-type="dijit.layout.BorderContainer" style="width:100%;height:100%;display:none" data-dojo-props="design:'sidebar'">
	<div data-dojo-type="dijit.layout.ContentPane" style="padding:0px;width:180px;" data-dojo-props="region:'left'">
		<div data-dojo-id="menuAppList" data-dojo-type="dijit.Menu" data-dojo-props="style:'border-left:none;border-right:none;width:100%'" >
		</div>
	</div>
	<div id="mainext" data-dojo-type="dijit.layout.StackContainer" data-dojo-props="region:'center'" style="padding:0px;margin:0px;" >
	</div>
</div>

</body>
</html>